package com.zjp.birthdaymanager.viewpager;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by Administrator on 2016/4/17.
 */
public class MyPagerAdapter extends FragmentPagerAdapter {
    private List<Fragment> mFragments;


    public MyPagerAdapter(FragmentManager fm) {
        super(fm);
    }
    public MyPagerAdapter(FragmentManager fm, List<Fragment> fragments) {
        super(fm);
        this.mFragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        // 返回当前页
        return mFragments.get(position);

    }

    @Override
    public int getCount() {
        return mFragments.size();
    }
}
